#pragma once
#include"MyRBTree.h"
namespace lvfj
{
	template<class K>
	class set
	{	
	public:
		struct SetKeyOfT
		{
			const K& operator()(const K& key)
			{
				return key;
			}
		};
		typedef typename RBTree<K, const K, SetKeyOfT>::iterator iterator;

		//set(const K& key)
		//	:_t(key)
		//{}

		iterator begin()
		{
			return _t.begin();
		}
		iterator end()
		{
			return _t.end();
		}
		bool insert(const K& key)
		{
			return _t.Insert(key);
		}
	private :
		RBTree<K, const K,SetKeyOfT> _t;
	};
}

void TestSet()
{
	set<int> st;
	int a[] = { 1,2,2,2,2,4,5,6,8,9,5,2,6,8,10,6,7 };
	for (auto &e : a)
	{
		st.insert(e);
	}
	set<int>::iterator it = st.begin();
	while (it != st.end())
	{
		cout << *it << " ";
		++it;
	}
	cout << endl;
}